﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UploadImageAdd.aspx.cs"
    Inherits="Gmis.Web.Manage.Village.UploadImageAdd" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function checkFile(selFile) {
            //alert(selFile.value);

            var extStr = ".jpg;.jpeg;.flv;";
            //alert(extStr);
            var fileName = selFile.value;
            if (fileName == "") {
                alert('请选择文件');
            }
            var nIndex = fileName.lastIndexOf(".");
            //alert(nIndex);
            var ext = fileName.substring(nIndex + 1);
            if (extStr.toLowerCase().indexOf(ext.toLowerCase()) < 0) {
                alert("文件格式不合法，请重新选择");
                var html = document.getElementById('uploadSpan').innerHTML;
                document.getElementById('uploadSpan').innerHTML = html;
            }
        }
    </script>
</head>
<body>
  
    <div class="pageContent"><span id='uploadSpan'></span>
        <form method="post" action="Village/UploadImageHandler.ashx" class="pageForm required-validate"
       enctype="multipart/form-data"    onsubmit="return iframeCallback(this,dialogAjaxDone);">
        <div class="pageFormContent nowrap">
            <input type="hidden" name="txt_sId" value="<%=sId %>" />
            <input type="hidden" name="action" value="<%=action %>" />
            <input type="hidden" name="txt_sType" value="<%=fileType %>" />
            <dl>
                <dt>标题:</dt>
                <dd>
                    <input type="text" name="txt_sTitle" value="<%=model.sTitle %>" class="required" />
                </dd>
            </dl>
            <dl>
                <dt>上传日期:</dt>
                <dd>
                    <input type="text" name="txt_dDate" class="required date" yearstart="-80" yearend="5" value="<%= model.dDate.ToString("yyyy-MM-dd") %>"/><a class="inputDateButton"
                        href="javascript:;">选择</a>
                </dd>
            </dl>
            <dl>
                <dt>文件:</dt>
                <dd>
                    <input type="file" name="file_Upload"  onchange="checkFile(this);" value=""    style="width: 410px" />
                </dd>
            </dl>
            <dl>
                <dt>文件描述:</dt>
                <dd>
                    <textarea class="editor" name="txt_sContent" rows="20" cols="80" tools="simple" upimgurl="UploadFile.ashx?action=village"
                        upimgext="jpg,jpeg,gif,png"><%=model.sDescription %></textarea>
                </dd>
            </dl>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">
                                提交</button></div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">
                                关闭</button></div>
                    </div>
                </li>
            </ul>
        </div>
        </form>
    </div>
</body>
</html>
